<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>resolve</title>
</head>
<body>
    <script>
        // Promise.resolve 
        //作用: 快速创建 promise 实例对象
        // let res = Promise.resolve(任意类型);

        //若参数值不是一个 promise 实例对象, 返回的结果值就是『成功』的 promise 对象
        //返回一个『成功状态』的 promise 实例对象
        // let res = Promise.resolve(123);
        // let res = Promise.resolve('iloveyou');

        // 若参数值是一个 promise 实例对象, 返回 promise 的状态由传入的 promise 对象状态决定
        // let res = Promise.resolve(new Promise((resolve, reject) => {
        //     resolve('ok');
        // }));    

        // let res = Promise.resolve(new Promise((resolve, reject) => {
        //     reject('error');
        // }));    


        let res = Promise.resolve(Promise.resolve(Promise.resolve(Promise.resolve(123))));

        console.log(res);
    </script>
</body>
</html>